package com.zr.ssm.mapper;

import com.zr.ssm.pojo.ArticalCate;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ArticalCateMapper {

    @Select("select * from ev_article_cate")
    List<ArticalCate> selectAll();

    @Insert("insert into ev_article_cate(name, alias) values(#{name}, #{alias}) ")
    int addCates(ArticalCate articalCate);

    @Delete("delete from ev_article_cate where id = #{id}")
    int deleteCateById(Integer id);

    @Select("select * from ev_article_cate where id = #{id}")
    ArticalCate selectById(Integer id);

    @Update("update ev_article_cate set name = #{name}, alias = #{alias} where id = #{id}")
    int updateCateById(ArticalCate articalCate);
}
